home *** CD-ROM | disk | FTP | other *** search
/ Carousel / CAROUSEL.cdr / mactosh / util / simulare.sit / Simula 4.07 Reference / card_45070.txt < prev    next >
Text File  |  1989-05-02  |  3KB  |  147 lines

  1. -- card: 45070 from stack: in.07 Reference
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 13647
  5. -- name: 
  6.  
  7.  
  8. -- part 1 (field)
  9. -- low flags: 00
  10. -- high flags: 0000
  11. -- rect: left=14 top=94 right=314 bottom=495
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 0
  15. -- font id: 3
  16. -- text size: 9
  17. -- style flags: 0
  18. -- line height: 12
  19. -- part name: 
  20.  
  21.  
  22. -- part 2 (button)
  23. -- low flags: 00
  24. -- high flags: A004
  25. -- rect: left=351 top=290 right=312 bottom=435
  26. -- title width / last selected line: 0
  27. -- icon id / first selected line: 0 / 0
  28. -- text alignment: 1
  29. -- font id: 0
  30. -- text size: 12
  31. -- style flags: 0
  32. -- line height: 16
  33. -- part name: Simset
  34. ----- HyperTalk script -----
  35. on mouseUp
  36.   go to card id 29187
  37. end mouseUp
  38.  
  39.  
  40.  
  41.  
  42. -- part 3 (button)
  43. -- low flags: 00
  44. -- high flags: 0000
  45. -- rect: left=219 top=295 right=314 bottom=248
  46. -- title width / last selected line: 0
  47. -- icon id / first selected line: 1014 / 1014
  48. -- text alignment: 1
  49. -- font id: 0
  50. -- text size: 12
  51. -- style flags: 0
  52. -- line height: 16
  53. -- part name: 
  54. ----- HyperTalk script -----
  55. on mouseUp
  56.   visual effect wipe down
  57.   go to previous card
  58. end mouseUp
  59.  
  60.  
  61.  
  62. -- part 4 (button)
  63. -- low flags: 00
  64. -- high flags: 0000
  65. -- rect: left=252 top=295 right=314 bottom=278
  66. -- title width / last selected line: 0
  67. -- icon id / first selected line: 1013 / 1013
  68. -- text alignment: 1
  69. -- font id: 0
  70. -- text size: 12
  71. -- style flags: 0
  72. -- line height: 16
  73. -- part name: c
  74. ----- HyperTalk script -----
  75. on mouseUp
  76.   visual effect wipe up
  77.   go to next card
  78. end mouseUp
  79.  
  80.  
  81.  
  82. -- part 5 (button)
  83. -- low flags: 00
  84. -- high flags: 0000
  85. -- rect: left=462 top=290 right=313 bottom=492
  86. -- title width / last selected line: 0
  87. -- icon id / first selected line: 1012 / 1012
  88. -- text alignment: 1
  89. -- font id: 0
  90. -- text size: 12
  91. -- style flags: 0
  92. -- line height: 16
  93. -- part name: 
  94. ----- HyperTalk script -----
  95. on mouseUp
  96.   domenu "back"
  97. end mouseUp
  98.  
  99.  
  100.  
  101. -- part contents for background part 2
  102. ----- text -----
  103. Use of Simset
  104.  
  105. -- part contents for background part 1
  106. ----- text -----
  107. Customers in line in front of a counter in a post office:
  108.  
  109.   
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.    
  124.  
  125. -- part contents for card part 1
  126. ----- text -----
  127. Simset begin
  128.    class Counter(ServiceTime); real ServiceTime;
  129.    begin ref(Head) WaitingLine;
  130.       procedure Service(C); ref(Customer) C; ...; ! -- service a customer;
  131.       WaitingLine :- new Head;
  132.    end;
  133.    Link class Customer(ArrivalTime); real ArrivalTime;;
  134.    ref(Counter)TheCounter; ref(Customer) C;
  135.    real Time;
  136.  
  137.   TheCounter :- new Counter(10);
  138.    while Time<1000 do
  139.    begin
  140.       C :- new Customer(Time); C.Into(TheCounter.WaitingLine);
  141.       if not TheCounter.WaitingLine.Empty and ...the clerk not busy... then
  142.       begin C :- TheCounter.WaitingLine.First; TheCounter.Service(C); C.Out; end;
  143.       Time := Time+1;
  144.    end;
  145.  
  146.  
  147.